<%@ page contentType="text/html;charset=UTF-8" language="java" import="iso3.pt.action.*" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<html>

<head>
    <link href="<s:url value="/css/main.css"/>" rel="stylesheet" type="text/css"/>
	<title><s:text name="application.title"/></title>
</head>
<body>
	<s:actionerror/>
	<div class="titleDiv"><s:text name="application.title"/></div>
	<h1><s:text name="label.lecturerSubjects.SubjectListTaught"/> <s:property value="lecturer.nombre"/> (<s:property value="lecturer.Dni"/>)</h1>

	<s:url action="loginAction!Logout"  id="logout" escapeAmp="false"></s:url>		
	<a href="<s:property value="#logout"/>"><s:text name="label.logout.button"/></a>
		
	<table class="borderAll">
		    <tr>
		        <th><s:text name="label.lecturerSubject.code"/></th>
		        <th><s:text name="label.lecturerSubject.namesub"/></th>
		        <th><s:text name="label.lecturerSubject.credits"/></th>
		        <th><s:text name="label.lecturerSubject.teacher"/></th>
		        <th><s:text name="label.lecturerSubject.list"/></th>
		        <th><s:text name="label.lecturerSubject.noStudents"/></th>
		        <th>&nbsp;&nbsp;</th>
		    </tr>
		    <s:iterator value="setOfSubjects" status="status">
		         <tr class="<s:if test="#status.even">even</s:if><s:else>odd</s:else>">
		            <td class="nowrap"><s:property value="%{ Id }"/></td>
		            <td class="nowrap"><s:property value="%{ Nombre }"/></td>
		            <td class="nowrap"><s:property value="%{ Creditos }"/></td>
		            <td class="nowrap"><s:property value="lecturer.nombre"/></td>
		            <td class="nowrap">
			            <s:url action="subjectAction!listUnitsLecturer"  id="units" escapeAmp="false">
		            		<s:param name="subjectID" value="%{ Id }"/>
						</s:url>
						<a href="<s:property value="#units"/>"><s:text name="%{ unidades.size }"/></a></td>
		            <td class="nowrap"><s:property value="matriculacion.size"/></td>
		            <td class="nowrap">
			            <s:url action="lecturerAction!listStudents"  id="studentslist" escapeAmp="false">
		            		<s:param name="subjectID" value="%{ Id }"/>
						</s:url>
						<a href="<s:property value="#studentslist"/>"><s:text name="label.lecturer.button"/></a></td>
		        </tr>
			</s:iterator>
	</table>
	
</body>
</html>